/**
 * JAVACC DEMO 1.0
 * @copy right dwusoft company All rights reserved. 
 * @Package com.zbxsoft.utr.service.plugins  
 */
package com.apache.bid.service.adminplugins;

import com.apache.api.vo.ParamsVo;
import com.apache.api.vo.ResultEntity;
import com.apache.bid.common.BidCommonUtil;
import com.apache.bid.common.Constant;
import com.apache.bid.service.plugins.UnityStopSessionPluginImpl;
import com.apache.cache.util.Validator;
import com.apache.rpc.client.RpcProtoclClient;

/**
 * description:  暂停session，同步加载缓存插件
 * 输入：ParamsVo（要暂停的sessionId）
 * 输出：T/F
 * 业务：暂停活动：将活动的状态改为3，并将该活动下所有的标的的状态改为3，并把所有标的清除缓存	
 * @author xhe 创建时间：2016-03-21  
 * 
 */
public class StopSessionPluginImpl extends UnityStopSessionPluginImpl {

	public Object execute(ParamsVo sessionVo) throws Exception {
		ResultEntity ret = new ResultEntity();
		if (Constant.getInstance().ifWriteDatabase()) {
			ret = (ResultEntity) super.execute(sessionVo);
		} else {
			if (Validator.isNotNull(sessionVo.getInfoId())) {
				sessionVo.setParams("infoId", sessionVo.getInfoId());
			}
			sessionVo.setParams("infoId", sessionVo.getInfoId());
			ret = RpcProtoclClient.getInstance().doService("wbdCacheService", "stopSession", sessionVo.getParams(),
					BidCommonUtil.getInstance().getInterfaceRegister("", ""));
			log.info("result=" + ret.getResult() + ";msg=" + ret.getMessage());
		}
		return ret;
	}

}
